<html>
<body>
<script language=JavaScript>
function closeIt() {
close();
}
</script>
<?php
require("../config.php");

if($_SESSION['login'] != "" && $_SESSION['pass'] != ""){
  if($_POST['trick'] != ""){ 
   $login = $_SESSION['login'];
    $trick = $_POST['trick'];
    $query = "INSERT INTO tricks VALUES('$login','$trick')";
    $result = mysql_query($query);
    echo "Your trick saved. <form><input onclick=closeIt() type=button value=Close></form>";
  };
  mysql_close();

};
?>
<p>Add new trick: </p> 
<form action=addtrick.php method=POST> 
<input type=text name=trick value=Trick><input type=Submit> 
</form> 
</body>
</html>
